﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Recharge.aspx.cs" Inherits="YY.Web.MyAgent.financial_information.Recharge" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>充值</title>
    <link type="text/css" href="/css/finance.css" rel="stylesheet" />
    <link type="text/css" href="/css/common.css" rel="stylesheet" />
    <script src="/jQuery/jquery-1.8.3.min.js"></script>
    <script src="/jQuery/Common.js"></script>
    <script src="/js/common.js"></script>
    <style type="text/css">
        .recharge-con .recharge-item {
            font-size: 24px;
        }

        .btnhide {
            display: none;
        }


        .pay-confirm {
            position: absolute;
            left: 50%;
            z-index: 1000;
        }

        #bg {
            background-color: #DEDEDE;
            position: absolute;
            z-index: 99;
            left: 0;
            top: 0;
            display: none;
            width: 100%;
            height: 100%;
            opacity: 0.5;
            filter: alpha(opacity=50);
            -moz-opacity: 0.5;
        }
    </style>
    <script type="text/javascript">
        function LoadPayType() {
            $.post("FinanceHandler.ashx?action=GetPaymentMethod", function (data, status) {
                if (status == "success") {
                    var infor = JSON.parse(data);
                    var htmlstring = "";
                    var htmlstr = "";
                    for (var i = 0; i < infor.length; i++) {
                        htmlstring += "<dd class='off'  id='select_" + infor[i].ID + "' onclick='ChooseBankCard(this);' onmouseover='MouseOverBankCard(this);' onmouseout='MouseOutHoverdivOfOne(this);' >";
                        htmlstring += "<div class='hover-con' id='" + infor[i].ID + "' onclick='ChooseBankCard2(this);' onmouseout='MouseOutHoverdiv(this);'>" + infor[i].DataName + "</div>";
                        htmlstring += "<div class='select-pic'></div>";
                        htmlstring += "<a href='javascript:;' style='border:0px;'> ";
                        htmlstring += " <img src='" + infor[i].DataIcon + "' style='width:182px;height:62px;'></a></dd>";
                    }
                    $("#dl_list").html(htmlstring);
                }
            });
        }

        function ChooseBankCard(i) {
            var bankid = i.id;
            var PID = $(i).parent().attr("id");
            if (PID == "dl_list") {
                $("#" + bankid).attr("class", "on");
                $($(i).siblings()).attr("class", "off");
            }
        }

        function ChooseBankCard2(i) {
            var bankid = "select_" + i.id;
            var paytitle = $("#" + i.id).html();
            $("#span_PayType").val(paytitle);
            var PID = $(i).parent().parent().attr("id");
            if (PID == "dl_list") {
                $("#" + bankid).attr("class", "on");
                $($(i).parent().siblings()).attr("class", "off");
            }
        }

        function MouseOverBankCard(i) {
            var bankid = i.id;
            var PID = $(i).parent().attr("id");
            if (PID == "dl_list") {
                if ($("#" + bankid).attr("class") != "on") {
                    $("#" + bankid).attr("class", "mouse-hover");
                    if ($($(i).siblings()).attr("class") != "on") {
                        $($(i).siblings()).attr("class", "off");
                    }
                }
            }
        }

        function MouseOutHoverdiv(i) {
            var id = i.id;
            if ($("#select_" + id).attr("class") != "on") {
                $("#select_" + id).attr("class", "off");
            }
        }

        function MouseOutHoverdivOfOne(i) {
            if ($(i).attr("class") != "on") {
                $(i).attr("class", "off");
            }
        }

        function CheckMoney() {
            var money = $("#txt_Money").val();
            var patytype = $("#span_PayType").val();
            if (checkMoney(money)) {
                $("#error_infor").hide();
                return true;
            }
            else {
                $("#error_infor").show();
                return false;
            }
        }

        function CheckMoney2() {
            var money = $("#txt_Money").val();
            var patytype = $("#span_PayType").val();
            if (checkMoney(money)) {
                $("#error_infor").hide();
                if (patytype == "") {
                    $("#error_infor2").show();
                    return false;
                }
                else {
                    $("#error_infor2").hide();
                    return true;
                }
            }
            else {
                $("#error_infor").show();
                return false;
            }
        }

        function showdiv(obj) {
            $("#bg").css({
                display: "block", height: $(document).height()
            });
            var $box = $('.pay-confirm');
            $box.css({
                //设置弹出层距离左边的位置
                left: ($("body").width() - $box.width()) / 2 - 20 + "px",
                //设置弹出层距离上面的位置
                top: ($(window).height() - $box.height()) / 2 + $(window).scrollTop() + "px",
                display: "block"
            });
        }

        
        $(function () {
            LoadPayType();
            $(".confirm-close").click(function () {
                $("#bg,.pay-confirm").css("display", "none");
            });
        })
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:HiddenField ID="span_PayType" runat="server" />
        <!--content begin-->
        <div class="wrap jy-bg">
            <div class="trade-bt w1120 clearfix">
                <div class="trade-tit"><a href="javascript:;" class="cur">&nbsp;充&nbsp;值&nbsp;</a></div>
            </div>
        </div>
        <div class="recharge-con">
            <div class="recharge-item"><span>充值账号：</span><span class="yellow"><%= UserName %></span> </div>
            <div class="recharge-item">
                <span>充值金额：</span><span>
                    <p>
                        <input id="txt_Money" runat="server" type="text" class="money-input" onblur="CheckMoney();" />
                        元
                    </p>
                    <p id="error_infor" class="cz-tips" style="display: none;">转入金额数值必须为整数或小数，小数点后不超过2位</p>
                </span>
            </div>
            <div class="recharge-item">
                <span>选择支付方式：</span><span class="cz-bank">
                    <div class="cz-banklist clearfix">
                        <dl id="dl_list" class="b-lb">
                        </dl>
                        <div id="div_otherbank" class="cz-otherbank otherbank-hover" style="display: none;">
                            <a href="javascript:;" class="otherbtn">选择其他银行<i class="clickicon"></i></a>
                            <div class="cz-otherlist">
                                <dl id="dl_otherlist" class="b-lb">
                                </dl>
                            </div>
                        </div>
                    </div>
                    <p id="error_infor2" class="cz-tips" style="display: none;">请选择支付方式</p>
                </span><span>
                    <asp:LinkButton ID="LinkButton1" runat="server" class="cz-submit" OnClientClick="return CheckMoney2();" OnClick="LinkButton1_Click">去银行页面支付</asp:LinkButton>
                </span>
            </div>
            <div class="cz-notice">
                <p>最新公告：</p>
                <p class="yellow">用户每日在乐老族充值金额超过900元的部分会被划分为冻结资金，自充值当日5天之后方可转为可提现余额予以提现 。为了您的账户资金安全，请勿使用他人银行卡进行充值。</p>
                <p>您的充值额度，由您所持银行卡的网上支付额度，以及银行配置给第三方支付平台的额度来决定。如对实时支付额度信息不明，您可咨询银行方面或者第三方支付平台，如果给您带来不便，还请您谅解，谢谢！ </p>
                <p>充值期间，请勿关闭浏览器，待充值成功并返回后，所充资金才能入账，如有疑问，请联系客服；若银行卡已扣款，乐老族总资产当中未增加对应充值金额，请稍作等待并刷新页面，超过5分钟还未到账，请及时联系客服处理。详情请咨询乐老族客服热线：4008005200.谢谢！</p>
            </div>
        </div>
        <!--content end-->
        
        <div id="bg"></div>
        <div class="pay-confirm" style="display:none;">
            <div class="confirm-tit">￥支付确认<a href="javascript:;" class="confirm-close" title="关闭"></a></div>
            <div class="confirm-con">
                <p class="qr-tips">尊敬的用户，您正在通过在线支付的方式进行充值。</p>
                <p class="qr-item">本次充值:&nbsp;<span class="hs"><%= CheckMoney %></span></p>
                <p class="qr-item">充值账户:&nbsp;<%= UserName %></p>
                <p class="qr-item">充值时间:&nbsp;<asp:Literal ID="lblCZTime" runat="server"></asp:Literal></p>
                <div class="qr-handle">
                    <span>
                        <asp:LinkButton ID="LinkButton2" runat="server" class="pay-success-btn" OnClick="LinkButton2_Click">支付成功</asp:LinkButton>
                        <asp:LinkButton ID="LinkButton3" runat="server" class="pay-fail-btn" OnClick="LinkButton3_Click">支付失败</asp:LinkButton>
                    </span><span><a href="javascript:;" class="help-link">查看帮助>></a></span>
                </div>
            </div>
        </div>
    </form>
</body>
</html>
